package com.zeta.eduservice.controller.question;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zeta.base.BaseController;
import com.zeta.commonutils.R;
import com.zeta.eduservice.entity.question.EduPaper;
import com.zeta.eduservice.entity.vo.PaperAnswerVo;
import com.zeta.eduservice.entity.vo.PaperListVo;
import com.zeta.eduservice.entity.vo.PaperVo;
import com.zeta.eduservice.service.EduPaperService;

import lombok.Data;

/**
 * <p>
 * 试卷 前端控制器
 * </p>
 *
 * @author zeta
 * @since 2020-08-13
 */
@CrossOrigin
@RestController
@RequestMapping("/eduservice/edu_paper")
public class EduPaperController extends BaseController<EduPaper>{

	@Autowired
	private EduPaperService paperService;

	@Override
	public IService<EduPaper> getBaseService() {
		// TODO Auto-generated method stub
		return paperService;
	}
@GetMapping("getPaperListById/{courseId}")
	public  R getPaperListByCourseId(@PathVariable String courseId) {
 List<PaperListVo> list = paperService.getPaperAndTypeListByCourseId(courseId);
		return R.ok().data("list",list);
	}
@GetMapping("getPaperById/{paperId}")
public  R getPaperByPaperId(@PathVariable String paperId) {
PaperListVo list = paperService.getPaperByPaperId(paperId);
	return R.ok().data("object",list);
}
	
}

